package com.wrupple.muba.base.client.module;

import com.google.gwt.inject.client.AbstractGinModule;
import com.google.gwt.place.shared.PlaceHistoryHandler.DefaultHistorian;
import com.google.gwt.place.shared.PlaceHistoryHandler.Historian;
import com.google.gwt.place.shared.PlaceHistoryMapper;
import com.google.inject.Singleton;
import com.wrupple.muba.base.client.module.services.logic.DesktopActivityMapperImpl;
import com.wrupple.muba.base.client.module.services.logic.DesktopLoadingContext;
import com.wrupple.muba.base.client.module.services.logic.DesktopPlaceHistoryMapperImpl;
import com.wrupple.muba.base.client.module.services.logic.DesktopSelectionStateDelegate;
import com.wrupple.muba.base.client.module.services.logic.DesktopSelectionStateDelegateImpl;
import com.wrupple.muba.base.client.state.DesktopPlaceSelectionState;
import com.wrupple.muba.base.client.state.impl.DesktopPlaceSelectionStateImpl;
import com.wrupple.muba.common.client.activity.IconWithLabelPlaceDelegate;
import com.wrupple.muba.common.client.state.GridSelectionState.GridPlaceSelectionStateDelegate;
import com.wrupple.muba.common.shared.State.Context;
import com.wrupple.muba.desktop.client.module.DesktopActivityMapper;

public class MubaDesktopModuleConfig extends AbstractGinModule {
	
	

	protected void configure() {
		/*
		 * Basic Shared Desktop Services
		 * 
		 * (only bounded here, the rest of the modules access them via providers
		 */

		bind(Context.class).to(DesktopLoadingContext.class).in(Singleton.class);
		
		bind(MubaDesktopProcessManager.class).to(
				MubaDesktopProcessManagerImpl.class).in(Singleton.class);
		/*
		 * Desktop Structure
		 */
		bind(DesktopActivityMapper.class).to(DesktopActivityMapperImpl.class)
				.in(Singleton.class);
		bind(PlaceHistoryMapper.class).to(
				DesktopPlaceHistoryMapperImpl.class).in(Singleton.class);
		bind(Historian.class).to(DefaultHistorian.class).in(Singleton.class);
		
		/*
		 * Services
		 */
		bind(DesktopSelectionStateDelegate.class).to(
				DesktopSelectionStateDelegateImpl.class);
		bind(GridPlaceSelectionStateDelegate.class).to(
				IconWithLabelPlaceDelegate.class);
		/*
		 * Activities
		 */


		/*
		 * State and process
		 */
		bind(DesktopPlaceSelectionState.class).to(
				DesktopPlaceSelectionStateImpl.class);
		
		
	}

}
